import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class TextBasic extends StatelessWidget {
  const TextBasic({super.key});

  @override
  Widget build(BuildContext context) {
    return const Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text("Hello flutter devs"),
          Text(
            "Hello flutter devs",
            style: TextStyle(
                fontSize: 25,
                color: Colors.lightBlue,
                fontWeight: FontWeight.bold,
                backgroundColor: Colors.yellow,
                fontFamily: "IntelOneMono"),
          ),
          Text.rich(TextSpan(children: [
            TextSpan(
              text: "web: ",
            ),
            TextSpan(
              text: "https://flutterchina.club/",
              style: TextStyle(color: Colors.lightBlue),
              // recognizer: _tapGestureRecognizer,它是点击链接后的一个处理器（代码已省略）
            )
          ])),
          DefaultTextStyle(
              style: TextStyle(color: Colors.lightGreen), //1.设置文本默认样式
              child: Column(
                children: [
                  Text("Hello "),
                  Text("World "),
                  Text(
                    "I am Jack. ",
                    style: TextStyle(inherit: false, color: Colors.grey),//2.inherit不继承默认样式
                  ),
                ],
              ))
        ],
      ),
    );
  }
}
